package j20251025;

import java.awt.*;

public class PointFactory {
        public static Point createPointByXY(int x, int y) {
            Point p = new Point(x,y);
            return p;
        }
        public static Point createPointByRA(int r,int a) {
            Point p = new Point((int)(r*Math.cos(a)),(int)(r*Math.sin(a)));
            return p;
        }

    public static void main(String[] args) {
        Point p1 = createPointByXY(1, 2);
        System.out.println(p1);
        Point p2 = createPointByRA(1, (int) (Math.PI/2));
        System.out.println(p2);
    }
}
